﻿// Module:             Games Programming
// Assignment1:        Platformer Game
// Add game feature:   
// Student Number:     S10095741D
// Student Name:       Ng Cheong Sian

//////////////////////////////////////////////////////////////////////////
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using System;

namespace Game.UIScripts
{
    class MouseHandler
    {
        private Vector2 _pos;
        private readonly Texture2D _tex;

        public MouseHandler(Vector2 pos, Texture2D tex)
        {
            this._pos = pos;
            this._tex = tex;
        }

        public void Update(MouseState mouseState)
        {
            this._pos.X = mouseState.X;
            this._pos.Y = mouseState.Y;
        }

        public void Draw(GameTime gameTime, SpriteBatch spriteBatch)
        {
            spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend);
            spriteBatch.Draw(this._tex, this._pos, Color.White);
            spriteBatch.End();
        }
    }
}
